{% extends "MyEhr::layout.html.twig" %}
{% block content %}

    <div id="_wrapList">
      <div class="wrap-title dark-blue-bg">
      <h1 class="dark-blue-color">Personnel List</h1>
      </div>
      <div class="padding-4px">
      <a class="ov-link" href="#personnel">Add Personnel</a>
      </div>
      <div class="admin-filter-conf">
      <form>
      <table>
      	<tr>
        	<td>Search : </td><td><input type="text"  v /></td>
            <td>
            	<select>
                	<option>By Name</option>
                    <option>By Position</option>
                </select>
            </td>
            <td>
            	<select>
                	<option>All Positions</option>
                    <option>By Position</option>
                </select>
            </td>
            <td>
            	<select>
                	<option>BPMIGAS</option>
                    <option>By Position</option>
                </select>
            </td>
            <td>
            	<select>
                	<option>All Emp. Type </option>
                    <option>By Position</option>
                </select>
            </td>
            <td>
            	<input type="submit" value="GO"/>
            </td>
        </tr>
      </table>
      </form>
      </div>
      <div class="admin-table-container">

      <table width="100%" class="admin-lister ">
      <tfoot>
      <tr>
      	<td colspan="8">
        <div>PAGER</div>
        
        <div class="cboth">
        </div>
        </td>
      </tr>
      <tr class="dark-blue-bg">
      	<td colspan="8">
          <div class="float-l padding-4px">
          	Record Perpage
            <select name="pager" class="_drop-down-page-navigator">
              {% set pageList = [5,10,25,50,100] %}
              {% for perPage in pageList %}
              <option {{ perPage is sameas(pager.getPerPage) ? 'selected="selected"' : "" }} >{{ perPage }}</option>
              {% endfor %}
              
              
              </select>
          </div>

          <div class="float-r padding-4px">
          Page {{ pager.getCurrentPage }} of {{ pager.getTotalPages }} &nbsp;
          {% if pager.getFirstPage != pager.getCurrentPage %}
          <a class="ov-link bolder" href="{{ url('_personnel_list')}}?{{ pager.pagination.queryFirst }}">First</a> &nbsp;
          {% endif %}
          {% if pager.hasPrevious %}
          <a class="ov-link bolder" href="{{ url('_personnel_list')}}?{{ pager.pagination.queryPrevious }}">Prev</a> &nbsp;
          {% endif %}
          {% if pager.hasNext %}
          <a class="ov-link bolder" href="{{ url('_personnel_list')}}?{{ pager.pagination.queryNext }}">Next</a> &nbsp;
          {% endif %}
          {% if pager.getLastPage != pager.getCurrentPage %}
          <a class="ov-link bolder" href="{{ url('_personnel_list')}}?{{ pager.pagination.queryLast }}">Last</a>
          {% endif %}
          
          </div>
          <div class="cboth">
          </div>
          </td>
      </tr>
      </tfoot>
      <thead>
      	<tr class="odd">
        	<th>#</th>
            <th><a class="ov-link" href="{{ url('_personnel_list')}}?{{ pager.pagination.queryOrderBy_emp }}">Emp #</a></th>
            <th><a class="ov-link" href="{{ url('_personnel_list')}}?{{ pager.pagination.queryOrderBy_nama }}">Nama</a></th>
            <th><a class="ov-link" href="{{ url('_personnel_list')}}?{{ pager.pagination.queryOrderBy_jabatan }}">Jabatan</a></th>
            <th><a class="ov-link" href="{{ url('_personnel_list')}}?{{ pager.pagination.queryOrderBy_tmt_aktif }}">TMT Aktif</a></th>
            <th><a class="ov-link" href="{{ url('_personnel_list')}}?{{ pager.pagination.queryOrderBy_tmt_mpp }}">TMT MPP</a></th>
            <th><a class="ov-link" href="{{ url('_personnel_list')}}?{{ pager.pagination.queryOrderBy_emp_type }}">Emp. Type</a></th>
            <th>Actions</th>
        </tr>
      </thead>
      <tbody>
      	{% for personnel in personnels %}
        <tr class="">
        	<td>{{ loop.index + pager.getStartNumber }}</td>
            <td>{{ personnel.employee_no }}</td>
            <td><a class="ov-link" href="#{{ personnel.name | replace({' ' : '_', '.' : '_' }) }}">{{ personnel.name }}</a></td>
            <td>{{ personnel.position }}</td>
            <td>{{ personnel.tmt_aktif | date('m/d/Y')}}</td>
            <td>{{ personnel.tmt_mpp | date('m/d/Y') }}</td>
            <td>{{ personnel.emp_type }}</td>
            <td><a class="ov-link" href="#edit">Edit</a> | <a class="ov-link" href="#hapus">Hapus</a></td>
        </tr>
        {% endfor %}
      </tbody>
      </table>
      </div>
    </div>
{% endblock %}